﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using saigonbook.Dal;

namespace saigonbook.Biz
{
    public class BIZ_admin
    {
        public string username;
        public string password;
        public string hoten;
        public string Username
        {
            get { return username; }
            set { username  = value; }
        }
        public string Password
        {
            get { return password; }
            set { password = value; }
        }
        public string Hoten
        {
            get { return hoten; }
            set { hoten = value; }
        }
        public BIZ_admin()
        { }
        public BIZ_admin(string username, string password, string hoten)
        {
            this.username = username;
            this.password = password;
            this.hoten = hoten;
        }
        public List<BIZ_admin> Select_admin()
        {
            return DAL_admin.Select_admin();
        }

        public bool dangnhapthanhcong(BIZ_admin admin)
        {
            List<BIZ_admin> ds = Select_admin();
            List<BIZ_admin> dsdn = new List<BIZ_admin>();
            dsdn = ds.Where(ad => (admin.username == ad.username && admin.password == ad.password)).ToList();
            if (dsdn.Count > 0)
                return true;
            return false;
        }
    }
}
